<?php
echo $this->load->view ( 'header' );
?>
<!--头部开始-->
<div>
	<ul class="breadcrumb">
		<li><a href="<?php echo site_url('main'); ?>"><?php echo lang('set_system'); ?></a><span
			class="divider">/</span></li>
		<li><a
			href="<?php echo site_url($this -> config -> item('admin_folder').'role'); ?>"><?php echo $title; ?></a></li>
	</ul>
</div>
<!--头部结束-->
<?php
if ($this->session->flashdata ( 'message' )) {
	$message = $this->session->flashdata ( 'message' );
}
if ($this->session->flashdata ( 'error' )) {
	$error = $this->session->flashdata ( 'error' );
}
if (function_exists ( 'validation_errors' ) && validation_errors () != '') {
	$error = validation_errors ();
}
?>
		
		<?php if (!empty($message)): ?>
<div class="alert alert-info">
	<a class="close" data-dismiss="alert">×</a>
			<?php echo $message; ?>
		</div>
<?php endif; ?>
						<?php if (!empty($error)): ?>
<div class="alert alert-error">
	<a class="close" data-dismiss="alert">×</a>
			<?php echo $error; ?>
		</div>
<?php endif; ?>

<!--角色列表开始-->
<div class="row-fluid">
	<div class="box span12">
		<div class="box-header well">
			<h2>
				<i class="icon-info-sign"></i> <?php echo lang('product_list'); ?></h2>
			<div class="box-icon">
				<a href="#" class="btn btn-minimize btn-round"><i
					class="icon-chevron-up"></i></a> <a href="#"
					class="btn btn-close btn-round"><i class="icon-remove"></i></a>
			</div>
		</div>
		<div class="box-content">
			<table
				class="table table-striped table-bordered bootstrap-datatable datatable">
				<thead>
					<tr>
						<th><?php echo lang('product_num'); ?></th>
						<th><?php echo lang('product_name_cn'); ?></th>
						<th><?php echo lang('product_name_en'); ?></th>
						<th><?php echo lang('product_handle'); ?></th>
					</tr>
				</thead>
				<tbody>
                <?php if($datas):?>
						  	   <?php foreach($datas as $n => $role_datas): ?>
							<tr>
						<td  class="producttr"  data="<?php  $titleName = urlencode($role_datas['name_cn']); echo site_url($this -> config -> item('admin_folder').'product/filelist/'.$titleName.'/'.$role_datas['id']); ?>"><?php echo $role_datas['num'];?>	</td>
						<td  class="producttr"  data="<?php echo site_url($this -> config -> item('admin_folder').'product/filelist/'.$titleName.'/'.$role_datas['id']); ?>"><?php echo $role_datas['name_cn']; ?>	</td>
						<td  class="producttr"  data="<?php echo site_url($this -> config -> item('admin_folder').'product/filelist/'.$titleName.'/'.$role_datas['id']); ?>"><?php echo $role_datas['name_en']; ?>	</td>
						<td>
							<a
							href="<?php echo site_url($this -> config -> item('admin_folder').'product/form/'.$role_datas['id'].'/'.$titleName); ?>"
							title="<?php echo lang('role_edit'); ?>"><span
								title="<?php echo lang('role_edit'); ?>"
								class="icon  icon-wrench"></span></a>
							<a
							href="<?php echo site_url($this -> config -> item('admin_folder').'product/filelist/'.$titleName.'/'.$role_datas['id']); ?>"
							title="<?php echo lang('role_edit'); ?>"><span
								title="<?php echo lang('role_edit'); ?>"
								class="icon  icon-book"></span></a>
								<?php if($has):?>
								<a
							href="<?php echo site_url($this -> config -> item('admin_folder').'product/userlist/'.$titleName.'/'.$role_datas['id']); ?>"
							title="<?php echo lang('role_edit'); ?>"><span
								title="<?php echo lang('role_edit'); ?>"
								class="icon  icon-user"></span></a>
								            <?php endif;?>
								<a
							href="<?php echo site_url($this -> config -> item('admin_folder').'product/videolist/'.$titleName.'/'.$role_datas['id']); ?>"
							title="<?php echo lang('role_edit'); ?>"><span
								title="<?php echo lang('role_edit'); ?>"
								class="icon  icon-video"></span></a>
								<a
							href="<?php echo site_url($this -> config -> item('admin_folder').'product/commentlist/'.$titleName.'/'.$role_datas['id']); ?>"
							title="<?php echo lang('role_edit'); ?>"><span
								title="<?php echo lang('role_edit'); ?>"
								class="icon  icon-comment"></span></a>
																<?php if($has):?>

								 <a
							href="javascript:void(0);"
							onclick="return show_delete_confirm('<?php echo lang('delete_message');?>','<?php echo lang('delete_message_confirm');?>', '<?php echo site_url($this -> config -> item('admin_folder').'product/del/'.$role_datas['id']); ?>');"
							title="<?php echo lang('role_delete'); ?>"> <span
								title="<?php echo lang('role_delete'); ?>"
								class="icon icon-close"></span></a>
																            <?php endif;?>

										</td>
					</tr>
					  <?php endforeach; ?>
                <?php else:?>
                    <tr><td colspan="10"><div class="center"><h4>无任何数据</h4></div></td></tr>
                <?php endif;?>
            </table>
            <?php if($pagination):?>
                <div class="pagination pagination-centered">
                    <?php echo $pagination; ?>

                </div>
            <?php endif;?>
		</div>
	</div>
</div>
<!--角色列表结束-->
<?php
echo $this->load->view ( 'footer' );
?>
<script type="text/javascript">
	$(document).ready(function(){
		$(".producttr").click(function(){
			window.location=$(this).attr("data");
		})
	})
</script>
</body>
</html>
